Skip to content

[Mono.Android] Bind API-37.2 Beta 3 - #12421

Open
jonpryor wants to merge 5 commits into
dotnet:mainfrom
jonpryor:dev/jonpryor/jonp-bind-api-37.2
Open

[Mono.Android] Bind API-37.2 Beta 3#12421
jonpryor wants to merge 5 commits into
dotnet:mainfrom
jonpryor:dev/jonpryor/jonp-bind-api-37.2

Conversation

@jonpryor

Copy link
Copy Markdown
Contributor

Context: https://developer.android.com/about/versions/17/qpr2
Context: ec3d578

Android 17 QPR2 has been released.

Additionally, Google appears to be changing things up. For API-36*, there were two releases: 36 and 36.1, with API-36.1 being introduced in QPR2 (Quarterly Platform Release 2), and there were no other point releases for API-36*.

This year, API-37.1 was introduced in QPR1, and API-37.2 is being introduced in QPR2. Which means the TODO assumptions from ec3d578 within GetAndroidDefineConstants.cs are no longer valid, so bump that to 4, just in case.

As with API-37.1, @jonpryor cannot find a release announcement, so there isn't a lot to link to.

Step 1: bind it!
Step 2: Enumify it, make stable.

This is Step 1. We consider this binding unstable until we complete enumification (Step 2).


Pull Request
title and
description
should follow the
commit-messages.md workflow documentation, and in particular should include:

  • Useful description of why the change is necessary.
  • Links to issues fixed
  • Unit tests

@jonpryor
jonpryor force-pushed the dev/jonpryor/jonp-bind-api-37.2 branch 2 times, most recently from a39f174 to 86ab624 Compare August 18, 2026 20:06
Context: https://developer.android.com/about/versions/17/qpr2
Context: ec3d578
Context: 932224b

Android 17 QPR2 has been released.

  * [API-37.2 Beta 3 vs. API-37][0]

Additionally, Google appears to be changing things up.  For API-36*,
there were two releases: 36 and 36.1, with API-36.1 being introduced
in QPR2 (Quarterly Platform Release 2), and there were no other point
releases for API-36*.

This year, API-37.1 was introduced in *QPR1*, and API-37.2 is being
introduced in QPR2.  Which means the `TODO` assumptions from ec3d578
within `GetAndroidDefineConstants.cs` are no longer valid, so bump
that to *4*, just in case.

As with API-37.1, @jonpryor cannot find a release announcement, so
there isn't a lot to link to.

Step 1: bind it!
Step 2: Enumify it, make stable.

This is Step 1.  We consider this binding *unstable* until we complete
enumification (Step 2).

Additionally, the "auto `Color`" logic in 932224b introduces an error:

	…/Android.Resource.cs(841,11): error CS0283: The type 'Color' cannot be declared const

Update the `//field` metadata changes from 932224b so that `final`
fields aren't turned into `Color` instances.  These fields will remain
as `int` fields.

[0]: https://developer.android.com/sdk/api_diff/c-2-beta3/changes
The *existence* of an Android QPR1 API-37.1 release alongside an
Android QPR2 API-37.2 beta release throws us into a new scenario: the
need for (at least?) *three* workload packs:

  * API-37 [stable]
  * API-37.1 [currently unstable, but see dotnet#12418]
  * API-37.2 [unstable]

(It would not surprise @jonpryor if there's a 4th by the time we're
done with API-37.*…)

However, thus far we've only ever expected *two* packages, so the
need for a third is unique.

Add a new `@(AndroidBuildApiLevel)` item group to
`Configuration.props`, which lists all the Android API levels to
build, along with the information required to build them (associated
framework version, platform id, is it *unstable*).

Update `ConfigureWorkload.targets` so that instead of "hardcoding"
`@(_FrameworkListOutputs)` against a specific list of of API levels
(`$(AndroidDefaultTargetDotnetApiLevel)` {?!},
`$(AndroidLatestStableApiLevel)`, `$(AndroidLatestUnstableApiLevel)`),
it uses `@(AndroidBuildApiLevel)`.  However, MSBuild item expansion
*does not like* using multiple item groups, e.g.:

	<_RuntimeListOutputs Include="…%(AndroidAbiAndRuntimeFlavor.AndroidRuntime).%(AndroidBuildApiLevel.Identity)…" />

Work around this problem by using a "cross join" across item groups
by using an intermediate Target + `@(_AndroidBuildInfo)` item group,
allowing use of a *single* item group:

	<_RuntimeListOutputs Include="…%(_AndroidBuildInfo.AndroidRuntime).%(_AndroidBuildInfo.Identity)…" />

Update the `BuildExtraApiLevels` target to build all API levels within
`@(AndroidBuildApiLevel)`, overriding MSBuild properties based on the
`@(AndroidBuildApiLevel)` item metadata.

Update `tests` so that the `_AddMonoAndroidReference` target finds
and uses *stable* bindings.  If it references an *unstable* binding,
we get a bunch of CS0246 errors as *nothing can be found*, as
`-p:EnablePreviewFeatures=true` is required when referencing an
unstable binding…
@jonpryor
jonpryor force-pushed the dev/jonpryor/jonp-bind-api-37.2 branch from 86ab624 to b35741e Compare August 19, 2026 19:40
jonathanpeppers and others added 2 commits August 19, 2026 16:41
Use AndroidBuildApiLevel as the source of truth for targeting pack selection, pack creation, local workload setup, and preview platform dependencies. Preserve API 37.1 while adding API 37.2 coverage.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 00e1eb98-68d9-4047-a6b3-d3af6ddcd4a6
@jonathanpeppers

Copy link
Copy Markdown
Member

/review

@github-actions

github-actions Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Android PR Reviewer completed successfully!

Generated by Android PR Reviewer for #12421

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found one blocking correctness issue: the new API-level metadata marks stable API 37.1 as unstable, causing its Mono.Android.dll to carry RequiresPreviewFeatures. The API 37.2 binding and supporting pack-selection refactor otherwise look consistent.

CI is still in progress; the completed Android Tools checks and CLA check are passing, with the platform builds and Java.Interop checks still running.

Generated by Android PR Reviewer for #12421 · gpt56 · 218.3 AIC · ⌖ 8.86 AIC · ⊞ 25.7K
Comment /review to run again

Comment thread Configuration.props Outdated
Mark the 37.1 build as stable when forwarding IsUnstableVersion, and exercise its integration test without enabling preview features.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 00e1eb98-68d9-4047-a6b3-d3af6ddcd4a6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants